This archive contains the code and data necessary to replicate the TERGM results and ROC plots from 

Cranmer, Skyler J., Bruce A. Desmarais, and Elizabeth J. Menninga. "Complex dependencies in the alliance network." Conflict Management and Peace Science 29, no. 3 (2012): 279-313.

The ROC plots in the top-level directory, and the CSV files in the top level of ./Data are all generated by the code. These could be deleted if the user would like to generate all results from the source data alone. The source data is in ./Data/source_data.

The code in ./Code is written assuming that the working directory in R is set to the top-level replication archive (i.e., /cmps_replication).

The directory ./Code/bootstrap_code contains 20 files, each of which runs 200 of the 4,000 bootstrap iterations run for the analysis. 

The R script bootstrap_tergm.R simply runs all of the bootstrap scripts using a loop. The code is currently written to run the scripts serially, but could be parallelized (e.g., via foreach) to improve speed. It takes approximately 4–5 hours to run buutstrap_tergm.R, as written.

The R script make_analysis.R runs the entire analysis—reads in the data, calls the bootstrap code, produces the ROC plots, and, at the end of the file, produces LaTeX tables of the TERGM results using xtable().

To run everything, the user can simply run the following from the terminal

R CMD BATCH ./Code/make_analysis.R 

or the following from the R console

source(“./Code/make_analysis.R”)